<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>Verify results against Easing 1.3 plugin</title>
	<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon" />
	<script src="../node_modules/jquery/dist/jquery.js"></script>
	<script>
	/* globals $ */
	/* eslint-disable no-unused-vars */
	var origEasing = $.extend(true, {}, $.easing);
	</script>
 	<script src="../jquery.easing.js"></script>
	<script>
	/* globals $ */
	var newEasing = $.extend(true, {}, $.easing);
	</script>
	<!-- loaded last because it refers back to the $.easing fns it defines	-->
 	<script src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script>
	<script>
	/* globals $ */
	var oldEasing = $.easing;
	</script>
	<style media="screen">
	#bounds {
		width: 250px;
		height: 250px;
		border: 1px solid #888;
	}
	#box {
		height: 50px;
		width: 50px;
		background: black;
	}
	</style>

	<script>
/* globals $ */
$(function() {
	var times = [
		0, 0.09, 0.15, 0.24, 0.37, 0.43, 0.50,
		0.58, 0.64, 0.76, 0.89, 0.92, 0.98, 1
	];

	$.each( oldEasing, function( name ) {
		var oldfn = oldEasing[ name ],
			newfn = newEasing[ name ];

		if ( typeof oldfn !== "function" || name === "swing" || name === "jswing" ) {
			return;
		}
		$( "#results").append( "<br />--- Testing " + name + " " );
		try {
			times.forEach( function( time ) {
				var ov = oldfn(time, time*1000, 0, 1, 1000),
					nv = newfn(time),
					diff = Math.abs(ov - nv);
				if (	Number.isNaN(diff) || diff > 0.001 ) {
					$( "#results").append("<br />at " + time + ": old " + ov + " new " + nv	);
				}
			});
			$( "#results").append( "Done" );
		} catch ( err ) {
			$( "#results").append( err );
		}
	});
});
	</script>
</head>
<body>
<h1>Easing function comparison</h1>
<p id="results"></p>


</body>
</html>
